Hmm... a grown man walking can generate about 50 watts per hour on a treadmill. 5000 men walking for 4 hours a day would generate 1000 kWh per day, roughly enough electricity to power 33 average American homes. (Which ruins a lot of a Zombie movie scenarios, right there.)
Average cost of 1000 kWh is about $200. While 5000 hamburgers is at least $10,000, so that's not feasible.
We have to switch to something cheaper. A 100g cup of white rice is about $0.25, so 5000 bowls of boring ass white rice is about $1250, so still too much. 100g of wholesale flour is about $0.07, which would be $350 total for our homeless treadmill walkers, still more expensive than grid power.
100g flour is about 130kcal, and 130kcal of pure sugar is about $0.04, or $200 for 5000 homeless. So our only way to make your plan viable is to go for pure sucrose efficiency.
Of course, walking for 4 hours burns about 1000kcal, so our homeless would rapidly starve on our sugar-water diet.