That's not a problem, that's the purpose of the current economical and political order in industrialized nations, whether they are capitalist, communist or mixed.
After all the horrors of the 20th century, including both world wars, it is not as easy anymore to trick the youth of the world to die on the battlefields, so the rulers have to device other means to get rid of the younger generations.
But we can't count on migration on the long term anyway, as countries with current net positive population growth rates are on the way to go sub-replacement in 1-2 generations as well.
Housing unaffordability should be pinned on NIMBY, bias against high density housing, and the decades long push to optimize housing as a rent-seeking friendly investment vehicle instead of simple dwellings. Today if you intend to buy an apartment in a high cost city, odds are that you must not only outbid people wanting to live there as well, but also rich people overseas that invest in real state as a way to stash money offshore and/or evade taxes.
It would if you'd import actual builders (which is strictly regulated industry). Instead we (NZ) get IT specialists (like me, lol) and if you are lucky - occasional nurse.