I'll expand on my comment, since you requested a "concrete example" of a Morse function. A (3-dimensional) lens space $L(p,q)$ is obtained from the unit sphere $S^3=\{(z_1,z_2)\in \mathbb{C}^2 | |z_1|^2+|z_2|^2 =1\}$ by quotienting by the action $(z_1, z_2) \mapsto (e^{2\pi i/p} z_1,e^{2\pi i q/p})$, which will have fundamental group $\mathbb{Z}/p$ when $gcd(p,q)=1$. There is a Morse-Bott function on $S^3$ given by $|z_1|^2$, which has two critical circles of index $0$ and $2$ when $z_1=0, z_2=0$. This function is obviously invariant under the cyclic group action, so it descends to a Morse-Bott function on $L(p,q)$ with two critical circles. One may perturb a Morse-Bott function in a neighborhood of a critical submanifold to be a Morse function, by adding a bump function on the normal coordinate times a Morse function on the critical submanifold, where the index adds. So one may perturb the Morse-Bott function on $L(p,q)$ near the critical cirles (when $z_1=0$, it will be a Morse function on $z_2$ times a bump function of $z_1$) to get index $0$ and $1$ critical points at one circle, and index $2$ and $3$ critical points at the other circle (a bump function of $z_2$ times a Morse function on $z_1$ near $z_2=0$). This is not quite explicit, but hopefully is concrete enough for you. Then $H_i(L(p,q);\mathbb{Z}/p)=\mathbb{Z}/p$ for $i=0,1,2,3$, so the Morse function is perfect with respect to $\mathbb{Z}/p$ coefficients.