Hi J-dizzal
Is what you call Ax the normal force from the wall? What will this be when contact is lost?
(P.S. it would be perpendicular to the wall, I think I can faintly see you drew it perpendicular and then erased it.)
Is what you call M0 is supposed to be the torque about O due to the weight of L-shaped part? You should be able to find an expression for this (assume the density is uniform).
You also need to find an expression for what you call Tm.
Then you should be good.edit:
Yes this will come into play in the expression for M0
(Also, this assume the density is uniform, which you have to assume, but it's good to recognize your assumptions.)