$CF$ is the angular bisector of $\angle ACB$. $AD$ is the perpendicular drawn from $A$ to $BC$. $E$ is the midpoint of $AC$
Here, I have proceeded as follows: since $\angle ACF = \angle FCB$ therefore $\frac{AC}{AM}=\frac{DC}{DM}$; by Pythagoras theorem in $\triangle MCD: MC^2 = DM^2 + DC^2$; Now how to proceed? Please help me.

This proof involves the area of triangles. For notation, I'm using $S_{ABC}$ to mean the area of triangle $\triangle ABC$.
First off, we have $MN = \frac13 NC$, therefore $S_{DMN} = \frac13 S_{DNC}$
We also have $AE = EC$, therefore $S_{DNA} = S_{DNC}$. This means $S_{DMN} = \frac13 S_{DNA}$, therefore $DM = \frac13 DA$, or $DM = \frac12 AM$.
By the angular bisector theorem we have $$ \frac{AM}{DM} = \frac{AC}{DC} = 2 $$
Since $\triangle ACD$ is a right triangle, we conclude that it must be a $30-60-90$ triangle, where $\angle ACB = 60^\circ$.
Since $CF$ is the angle bisector, we have $\angle FCD = 30^\circ$, making $\triangle CMD$ another $30-60-90$ triangle. With $NC = 4$, we have $DM = 2$ and $DC = 2\sqrt{3}$. We also have $AC = 4\sqrt{3}$ and $AD = 6$
Finally, since $AM = \frac13 AD$ and $FM = \frac13 FC$, $M$ must be the centroid of $\triangle ABC$ (one way to prove this is to observe that $S_{MBC} = \frac13 S_{ABC} = S_{MAB}$). This means $BD = DC$, hence $\triangle ACD$ and $\triangle ABD$ are congruent, and $\angle ABC = 60^\circ$.
Therefore $\triangle ABC$ is equilateral, and its perimeter is $3AC = 12\sqrt{3}$