In Mississippi and South Carolina, you can buy a house in many areas for sub-$100k, for a 1:2.5 salary-price ratio. Compare to Silicon Valley, where good tech salaries of $200k and 2 bdrm homes for $800k give a 1:4 ratio.
$40k is middle class for that part of the country.