Endogenous fertility and development traps with endogenous lifetime