I'm trying to understand why the pullback of
$$ \mathbb{Z} \xrightarrow{m} \mathbb{Z} \xleftarrow{n} \mathbb{Z} $$
in $\operatorname{Ab}$ with $m,n \neq 0$ is
\begin{array} \ \mathbb{Z} \xrightarrow{b} \mathbb{Z} \\ \downarrow^{a} \quad \downarrow^m \\ \tag{1} \mathbb{Z} \xrightarrow{n} \mathbb{Z} \end{array}
with $an = bm = \operatorname{lcm}(n,m)$. I understand that, for starters, for an abelian group to be the summit of such a cone, it must be free and so it has to be of the form $\mathbb{Z}^d$.
I also see that, if it were $d = 1$ and $f,g : \mathbb{Z} \rightarrow \mathbb{Z}$ with $f \simeq c \in \mathbb{Z}, g \simeq d \in \mathbb{Z}$ such that $mc = nd$, then both $mc$ and $nd$ are divided by $\operatorname{lcm}(n,m)$ and so we have that $a = \frac{\operatorname{lcm}(n,m)}{n} | d$ and $b = \frac{\operatorname{lcm}(n,m)}{m} | c$. Thus $f$ and $g$ factor through $a$ and $b$ as desired.
What I am missing is, how do we see that cones from $\mathbb{Z}^d$ for $d > 1$ factor trough $(1)$?
We should have $H:=\{(x,y) \in \mathbb Z \times \mathbb Z \mid nx=my\}$ with maps restricting canonical projections. Note that the total space is the kernel of $(x,y) \mapsto nx-my$.
Now you want to define an isomorphism $\phi:\mathbb Z \to H$ by $1 \mapsto (a,b)$.
Note that $\mathrm{Im}(\phi) \subset H$ since $an-bm=0$ by definition.
Moreover, note that if $nx=my$, then there exists some $z$ so that $(az,bz)=(x,y)$ since if $nx=my=d$, then $lcm(n,m) \mid d$.
Injectivity is evident, so we have an isomorphism.