And in your comment lies a possible solution. Support people into their mid-70s, and then the only medical care they get is palliative, so they don't suffer from whatever takes them out. Half of their estate is allocated to the social welfare fund.
Another solution is to increase the sources of funding. For example, in the United States, your Social Security contributions are capped once your income exceeds approximately $160,000. Eliminate that cap, and include income from other sources (i.e., taxes on estates, capital gains, and buy-borrow-die) in the Social Security tax calculation.
Any "solution" will have to work within the realm of political possibility. Elderly people also get to vote and I doubt they will support cutting off their own access to healthcare, or drastic increases in estate taxes.
Another solution is to increase the sources of funding. For example, in the United States, your Social Security contributions are capped once your income exceeds approximately $160,000. Eliminate that cap, and include income from other sources (i.e., taxes on estates, capital gains, and buy-borrow-die) in the Social Security tax calculation.