I have redrawn the diagram below. The mass M rotates about a point D on the fixed line AC. where angle ADM is a right angle. The component of gravity along DM is $g\cos\theta$ where $\theta$ is the angle CAB. So the swinging mass M is like a simple pendulum of of length DM in a gravitational field of strength $g\cos\theta$.

The value of $\cos\theta=c/h$ is easy to work out from $b,c$. We need to use geometry to work out the length DM.

The significance of the condition $l_1^2+l_2^2=b^2+c^2$ is that the triangle ABC is right angled, and shares the hypotenuse $AC=h$ with triangle AMC, therefore triangle AMC is also right angled and **similar to ABC**.

Triangle MDC is similar to triangle AMC, therefore $DM/MC=AM/AC$ hence $DM=L_1L_2/h$.

The above equations give you sufficient information to find the period of small oscillations.