Prices falling to their marginal cost of production does solve. Just hard to see from our existing system that dominates your view.
You don’t pay for the air you breath - why not? Marginal cost of production is zero - except in space or underwater where marginal cost is higher to service that air.
As jobs are replaced, prices fall naturally allowing people more for less which is the entire point of technological progress.