Some nonresidential firms have pivoted to homebuilding out of necessity. Others say the business is coming to them.