Social security and endogenous demographic change: child support and retirement policies