What counts is not the median age of the population.
What counts is "taxpayers" versus "tax consumers". Bringing in young people who will not earn enough to be net taxpayers actually makes the problem worse.
We need for the middle-class to be having more kids per couple, and for the underclass to stop having kids they cannot feed without government subsidy.
We need government policies that discourage unmarried teen motherhood. In Illannoy you get money for every kid the first through the fourteenth get you paid the same.