Distribution of $\frac{\overline X - \overline Y - (\mu_1 -\mu_2)}{\sqrt{\frac1{m+n-2} [(m-1)*s_1^2+(n-1)*s_2^2](\frac1{m}+\frac1{n})}}$

We end up with some $$U=\frac{\overline X-\overline Y-(\mu_1-\mu_2)}{\sigma\sqrt{\frac{1}{m}+\frac{1}{n}}}\sim N(0,1)$$

And some $$V=\frac{(m+n-2)s^2}{\sigma^2}\sim \chi^2_{m+n-2}$$

, where we have the pooled variance $$s^2=\frac{(m-1)s_1^2+(n-1)s_2^2}{m+n-2}$$

Now $U$ is a function of $\overline X$ and $\overline Y$, and $V$ is a function of $s_1^2$ and $s_2^2$. Moreover, $(\overline X,\overline Y)$ is independent of $(s_1^2,s_2^2)$ (this can be verified using MGFs since in fact $\overline X,\overline Y,s_1^2$ and $s_2^2$ are all mutually independent of each other). Since (measurable) functions of independent random variables/vectors are also independent of each other, it follows that $U$ and $V$ are independent.

The required statistic is of course $T=\frac{U}{\sqrt{V/(m+n-2)}}$.