Understanding Pareto Optimal
I see no problem in $m$ being absent from the equation, as it enters additively in the utility function. The partial utility obtained from this good is represented in the 1 that you get in the derivative. This is, the marginal utility obtained from an extra unit of $m$ is independent of the amount the individual consumes of $m$. Additionally, as both type of consumers value the $m$ good equally, the distribution of $m$ is then irrelevant for the optimality of any allocation. Your solution tells you that the relation between the level of consumption of $x_1$ and $x_2$ is that of 5 to 3.

Then, what you need to do is to allocate the aggregate resources among all consumers such that the proportion holds. If two two type of consumers have in total 40 units of $x$, then the allocation is that of 25 for type one consumers, and 15 for type two consumers.