A Multisector AK model with endogenous growth: Value function and optimality conditions