Endogenous Networks in Random Population Games