I read the section 3 of chapter 10 of do Carmo's Riemannian Geometry. In fact, it is reproduce of
Moore, John Douglas, An application of second variation to submanifold theory, Duke Math. J. 42, 191-193 (1975). ZBL0337.53045.
But I can't understand where use the simply connect in the proof. I have a guess, but clearly something is wrong.
If $\overline M$ is not simply connect, I have many "holes" on $\overline M$ such that the distance of two holes converge to $0$. Then, there are $q_i$ such that $\frac{\partial f}{\partial s}\rightarrow 0$ as $i\rightarrow \infty$. But such manifold is not complete.
Proof in do Carmo's book:





