This problem is easily solved by applying principles of classical Newtonian Mechanics.
The force exerted by M on m is given by GXmXM/(r^2) N = ma
Therefore acceleration a of m towards M = GM/r^2 which is variable, function of r.
According to classical mechanics if a is constant distance s = ut + (1/2) a t ^2 where u is initial speed = 0
because masses are at rest. The distance s is separation between masses which is r. Therefore above equation for our scenario is r = (1/2) t^2 GM ∫ (1/r^2) dr = (1/2) t^2×GM/r. Integration limits r to 0.
We can solve for t = r [2/GM]^1/2 sec. Please let me know how do you like this answer by sending me E-mail on WYZANT message.