Not wanting to devote 20% of a $200 million payroll to a single player over 31 for five years (i.e. from 2024-2028) wouldn't make them cheap. If they don't sign one of these guys they will still spend that $30 or 40 million on other players.
But, they do need the star, the payroll will probably be bigger than that, and they have plenty of time to make sure the cap is managed properly in those years. They don't have to repeat Gillick and Amaro's mistakes (and in fact, it would be impossible for them to do so, as they don't have five or six all-stars on a similar salary track (or at all) heading towards big paydays at the same time.
Personally, while I know it's an unpopular opinion, it would also be okay to repeat Gillick and Amaro's mistakes (and you can even include Wade in there). I'm not sure a truly sustainable year-after-year winner can be done though obviously the drafting failures and insufficent international contributed to the hollowing out, and the Yankees don't have that problem. But most teams, you go through cycles. That last era produced 10 winning seasons out of 11, they just should have made the playoffs sooner (2005) and won at least a second World Series (and probably three). Of course the Yankees have only won one since 1996 (and arguably part of their failure to do so since 2009 was because of the moves they made to get that one).