First there is an issue with your definition. The canonically conjugate momentum is
$$\pi=\dfrac{\partial \mathcal{L}}{\partial(\partial_0 \phi)}$$
In fact notice that in your equation the LHS carries no indices and the RHS carries one which should indicate something is actually wrong.
So you must differentiate $\mathcal{L}$ with respect to $\dot{\phi}=\partial_0\phi$.
Why is so? Well, this is a straightforward generalization of the canonically conjugate momentum from classical mechanics, where the momentum conjugate to $q$ is
$$p = \dfrac{\partial L}{\partial \dot{q}}$$
Now how do we compute this for the KG lagrangian? Well the Lagrangian is
$$\mathcal{L}[\phi,\partial_\mu\phi]=\frac{1}{2}\partial_\mu \phi \partial^\mu\phi-\frac{1}{2}m^2\phi^2=\frac{1}{2}\eta^{\mu\nu}\partial_\mu \phi\partial_\nu \phi-\frac{1}{2}m^2\phi^2$$
Hence it is a function of $\phi$ and $\partial_\mu \phi$ for $\mu=0,1,2,3$.
You should when differentiating regard $\phi,\partial_0\phi,\partial_1\phi,\partial_2\phi,\partial_3\phi$ as five different and independent coordinates!
So we compute
$$\frac{\partial \mathcal{L}}{\partial (\partial_0 \phi)}=\frac{1}{2}\eta^{\mu\nu}\frac{\partial}{\partial(\partial_0\phi)}(\partial_\mu \phi \partial_\nu\phi)$$
Where the last term vanishes because $\phi^2$ doesn't depend on $\partial_0\phi$.
Next we have
$$\frac{\partial \mathcal{L}}{\partial (\partial_0 \phi)}=\frac{1}{2}\eta^{\mu\nu}\left[\frac{\partial (\partial_\mu\phi)}{\partial(\partial_0\phi)}\partial_\nu\phi + \frac{\partial(\partial_\nu\phi)}{\partial(\partial_0\phi)}\partial_\mu \phi\right] =\frac{1}{2}\eta^{\mu\nu}\left[\delta_{\mu 0}\partial_\nu\phi+\delta_{\nu 0}\partial_\mu \phi\right]$$
Using the Kronecker deltas this is
$$\frac{\partial \mathcal{L}}{\partial (\partial_0 \phi)}=\frac{1}{2}\eta^{0\nu}\partial_\nu\phi+\frac{1}{2}\eta^{\mu 0}\partial_\mu \phi.$$
Finally if one works in the $(+,-,-,-)$ signature, $\eta^{\mu 0}= \delta_{\mu 0}$ and hence you get
$$\pi = \partial_0 \phi = \dot{\phi}.$$