Thanks to Dave BensonDave Benson for pointing out an algebra error in the first draft of this answer and a missing detail.
Suppose $X$ is homotopy equivalent to a finite dimensional, simply-connected, and noncontractible CW complex. Let $k=\mathbb{Q},\mathbb{Z}/p$. Then for one of these choices of $k$$k=\mathbb Q$ or $k = \mathbb Z/p$ for some $p$, there exists an $i>0$ such that $H_i(M; k)$ is nontrivial, otherwise $X$ would be contractible by the homology Whitehead theorem (see Corollary 3A.7.of Hatcher of Hatcher).
The KunnethKünneth theorem implies $H_{2i}(M \times M;k)$ is nontrivial which implies $M$ can't be homotopy equivalent to $M \times M$.
The simply-connectedness assumption is necessary since the homology could potentially vanish in all degrees.