Libertarians can just flip it round and say how do socialists solve the free rider problem? Neither system resolves both problems.
Extremist dogma is not a great way to run a society, but it does good numbers on social media, so here we are.
Democratic socialists and social democrats solve the free rider problem through general taxation and regulation.
Consider universal healthcare as the case in point for this; we absorb the cost of chronically ill people by mixing them in with the rest of the population, at a fraction of the price that the "free market" costs to attempt and fail to do the same thing.
> Libertarians can just flip it round and say how do socialists solve the free rider problem?
This is a fallacy (tu quoque/whataboutism). You're changing the subject to distract from the fundamental problem in libertarianism and implying that some other strawman is just as bad.
Without solving the fundamental problem, libertarianism will never work for anything but toy societies.
Only one is a reasonable problem in functioning societies, the other one mostly a fallacy.