You just have to keep the machine simple (not easy) enough so that everybody can fully understand and hack it.
You are right: with proper balance, capitalism could work.
Very early capitalism (the one studied by Adam Smith, for example) indeed worked quite well, since the high costs of communication and movement posed strong constraints on what people could achieve without mutual help and trust.
Now we just need to put such balance in place ex-lege: we should simply cap corporate dimensions so that beyond a certain point there would be no point to compete and collaboration would be the only rational choice.
Imagine if no company could have more than 100 employees, for example.
Or, way better, cap personal wealth so that the max wealth a person can hold would be linked to the min wealth any other person actually own.
In this system you would have an incentive to compete for a while, but above a certain threasold you would have an even bigger incentive to cooperate with everybody else since the only way to improve your wealth would be to raise the wealth of the poorest people on earth.
Link the maximum global wealth with the solar energy captured each year by earth in various forms and you have a sustainable economical system that accounts for personal differences and desires without being dominated by sociopaths.