1. Amazon could build a brand around treating workers better (UPS has at times had this reputation) and thus differentiate themselves and justify the cost of better pay and benefits.
2. Government regulations could require a certain standard of job creation or insurance coverage. These could be coupled with incentive programs.
3. Workers can organize. (i.e. into unions)
4. Consumers can vote with their dollars.
5. Investors can vote with their dollars.
There are many more variations on these themes.
If these kinds of solutions don't work, workers tend to get squeezed. Due to the complexities of our economic and political systems, in practice, certain companies end up treating human resources (people) as expendable assets to exploit. Sometimes they do so for a long time. That is why other power centers (government, labor organization, consumer activism, investor activism) are necessary to achieve broader goals.