Endogenous licensing in cumulative innovation