I think it is easier to choose an injective resolution to compute this group, as $$0\longrightarrow\mathbb Z\longrightarrow\mathbb Q\longrightarrow\mathbb Q/\mathbb Z\longrightarrow 0$$ is an injective resolution of $\mathbb Z$. Then consider the derived functor $R\operatorname{Hom}_{\mathbb Z}(\mathbb Q/\mathbb Z,-)$ and we have the long exact sequence
\begin{align}
\cdots\to\operatorname{Hom}_{\mathbb Z}(\mathbb Q/\mathbb Z,\mathbb Q)\to\operatorname{Hom}_{\mathbb Z}(\mathbb Q/\mathbb Z,\mathbb Q/\mathbb Z)
\to\operatorname{Ext}_{\mathbb Z}^1(\mathbb Q/\mathbb Z,\mathbb Z)\to\operatorname{Ext}_{\mathbb Z}^1(\mathbb Q/\mathbb Z,\mathbb Q)
\to\cdots
\end{align}
Note that $\mathbb Q/\mathbb Z$ is a torsion $\mathbb Z$-module while $\mathbb Q$ is torsion-free and thus $\operatorname{Hom}_{\mathbb Z}(\mathbb Q/\mathbb Z,\mathbb Q)=0$. Since $\mathbb Q$ is injective, $\operatorname{Ext}_{\mathbb Z}^1(\mathbb Q/\mathbb Z,\mathbb Q)=0$. Hence we arrive at $$\operatorname{Ext}_{\mathbb Z}^1(\mathbb Q/\mathbb Z,\mathbb Z)\simeq \operatorname{Hom}_{\mathbb Z}(\mathbb Q/\mathbb Z,\mathbb Q/\mathbb Z)\simeq\widehat{\mathbb Z},$$
for the last equal sign I found many post explaining it in MSE, for example, here.