Social Security works with economic growth. It doesn't matter if you get 10 babies or 10 robots. Automation makes possible to keep proper living standards without exponential population growth.
Social Security, as other services like education, stops working because it is not shared.
Actually, with enough automation, it is easier to satisfy a smaller population.
There are 3.5 million professional truck drivers in the United States. Self-driving trucks mean that you need 3.5 million fewer babies to carry out that task. Just 3 million if you actually need 500,000 people to maintain the software.
So, I agree with you that in the past Social Security was depending on population growth. That has been changing fast for the past 50 years. There is no economical reason to not have Social Security in the future.