Since CM is perpendicular to AB, it follows that ∠1 and ∠2 are 90 degrees. Since they both have 90 degree angles, that must mean they are both right triangles.
And since ∠3 = ∠4 and ∠1 = ∠2, then it follows that ∠A = ∠B. (You can show this by showing that they must add up to 180 degrees.)
So since both right triangles have 3 congruent angles to each, then that makes them similar by AAA (angle angle angle).