It is a compensation problem, not a capitalism problem
If senior management is being compensated in a way that encourages short term thinking - quarterly results, stock price, etc. then they'll manage the company accordingly. When management is compensated using long term measures, they'll manage with a long term viewpoint and you won't see them pursuing strategies that will hurt the company in 3-5 years just to make this quarter/FY numbers.
So long as you realize everyone is going to pursue their own self-interest, and set goals that align the long term interests of the company with people's self-interest, you'll be fine. When their self-interest conflicts with the long term interests of the company, then it is the fault of people who set their goals (or in the case of management that sets their own goals, the board that approved it or the shareholders that stood by the board)