If we as a society develop tools to remove people from production and leave them at the mercy of the modern jungle then the machines designed to do this will follow this path as well.
If we design machines to accomidate the needs of a large global population without regards to age, race, religion, productivity, or other factors that have historically been used to separate the "us" from the "them," then the machines will continue to solve the problems we designed them for.
We could, as a species, unanimously abandon all AI tomorrow, Dune-style, and the problems and paths of history would largely be the same. The strong will do as they please and the weak will suffer as they must.
We just need to be better to each other.