The only way to avoid this in the merciless capitalist culture we live in is to get a contract, and of course employers don't want to hand out contracts (unless you're in the executive suite, where everyone gets a contract).
Indeed, it's a fair argument to say that the artistocrat-serf divide under medieval feudalism is mirrored in the contract employee / at-will employee division under investment capitalism.
A key element in unionization efforts is the promise that all employees become contract employees, thus if the corporation wants to do a mass round of layoffs and re-hires to cut labor costs, severance pay under contract makes this an un-economical option for the executive suite.
For some mysterious reason, this reality is never taught in high school economics courses.