On manifolds with finitely generated homotopy groups