Show that if $p \nmid q - 1$, then $G$ is abelian, i.e. $Z(G) = G$.
We may assume that $Z(G) = 1$ then. Note that $G$ must contain an element $g$ of order $q$. Let $H = \langle g \rangle $. Since it has index $p$, it is normal, i.e. the normalizer $N(H)$ is $G$. Moreover, the center is trivial so the centralizer of $H$, $C(H)$ is $H$ itself. The quotient of these two, which is $G/H$ is a group of order $p$ (the index) which is isomorphic to a subgroup of the automorphisms of $H$. However, $H$ being cyclic of prime order $q$ means it has order $q-1$, so by Lagrange's Theorem, $p \mid q -1$ which is a contradiction. Therefore, $Z(G) = G$.