Suppose $G$ is a perfect group ($G=G'$) with the following properties. $G/Z(G)$ is a Tarski $p$-group or another simple finitely generated infinite group in which all proper subgroups are abelian, and $Z(G)$ is a direct sum of two cyclic groups $\langle c_1\rangle$ and $\langle c_2\rangle$ of order $p$, a prime.
Clearly setting $c_1\mapsto c_1c_2$ and $c_2\mapsto c_2$ will give us an automorphism of $Z(G)$. Is it possible, in these or similar circumstances to extend this automorphism to an automorphism of the whole group $G$?
Are there some sufficient conditions to do it, or one can only hope for some magic?