The beam squint effect that arises in the wideband Terahertz (THz) massive multiple-input multiple-output (MIMO) communication produces a serious array gain loss. True-time delay (TTD)-based hybrid precoding has been considered to compensate for the beam squint effect. By fixing the phase shifter (PS) precoder, a common strategy has been designing TTD precoder under the assumption of unbounded time delay values. In this paper, we present a new approach to the problem of beam squint compensation, based on the joint optimization of the TTD and PS precoders under per TTD device time delay constraints. We first derive a lower bound of the achievable rate and show that in the large system limit the ideal analog precoder that completely compensates for the beam squint is equivalent to the one that maximizes the achievable rate lower bound. Unlike the prior approaches, our approach does not require the unbounded time delay assumption; the range of time delay values that a TTD can produce is strictly limited in our approach. Instead of focusing on the design of TTD values only, we jointly optimize both the TTD and PS values to effectively cope with the practical time delay constraints. Taking the advantage of the proposed joint TTD and PS precoder optimization approach, we quantify the minimum number of TTDs required to produce a predefined array gain performance. The simulation results illustrate the substantially improved performance with the array gain performance guarantee of the proposed joint optimization method.