Intersection of median and segment between two sides of a triangle 
In triangle $ABC,$ $M$ is the midpoint of $\overline{BC},$ $AB=12,$ and $AC=16.$ Points $E$ and $F$ are taken on $\overline{AC}$ and $\overline{AB},$ respectively, and $\overline{EF}$ and $\overline{AM}$ intersect at $G.$ If $AE=2AF,$ then what is $EG/GF?$

This seemingly-easy problem (at least for my standards) is driving me crazy. I tried an analytical approach:

WLOG, assume that $\triangle{ABC}$ is right. (There is no specific angle measures.) Fix the points on the cartesian plane such that $A = (0, 0), B = (0, 12), \text{ and } C = (0, 16).$ Then $M$ is at $(8, 6)$, and the equation of line $AM$ is $y=\frac{3}{4}x.$ Next, let $E = (4, 0) \text{ and } F = (0, 8).$ The equation of line $EF$ is $y=-2x+8.$ Therefore, we have the system of equations $$y=\frac{3}{4}x$$$$y=-2x+8$$
Solving gets $$x=\frac{32}{11} \text{ and } y=\frac{24}{11}.$$
Therefore, the ratio of $EG$ to $GF$ is just $\frac{\frac{32}{11}}{4-\frac{32}{11}} = \frac{8}{3}.$

However, my approach is incorrect. Can anyone point out any flaws and present a solution to the correct answer? I also tried using mass points to no avail.
TIA!
 A: The key step is the ratio lemma. Let $b$ and $c$ be the measures of angles $BAM$ and $MAC$, respectively, and say $BM=m=MC$. Also, say $AF=\ell$ and $AE=2\ell$. Then, applying the ratio lemma to triangle $ABC$ at $A$, we have $\frac{\sin b}{\sin c}=\frac{m/12}{m/16}=\frac{4}{3}$. Then, we apply the ratio lemma to triangle $AEF$ at $A$ where $FG=x$ and $GE=y$ (we want $x/y$), so $\frac{4}{3}=\frac{\sin b}{\sin c}=\frac{x/\ell}{y/2\ell}=2\frac{x}{y}$. Thus $\frac{x}{y}=\frac{2}{3}$ (unless I've made a computation mistake).
A: This is an application to the law of sines.
In $\triangle ABC$:
$$\frac{\sin\angle ABC}{AC}=\frac{\sin\angle ACB}{AB}$$
In $\triangle ABM$:
$$\frac{\sin\angle BAM}{BM}=\frac{\sin\angle ABC}{AM}$$
In $\triangle CAM$:
$$\frac{\sin\angle CAM}{CM}=\frac{\sin\angle ACB}{AM}$$
In $\triangle FAG$:
$$\frac{\sin\angle BAM}{FG}=\frac{\sin\angle AGF}{AF}$$
In $\triangle EAG$:
$$\frac{\sin\angle CAM}{GE}=\frac{\sin\angle AGE}{AE}$$
Since $\angle AGF+\angle AGE=180^\circ$, you have $$\sin\angle AGF=\sin\angle AGE$$
Putting everything together, and if I did not do any mistakes, I get $$\frac{AC}{AB}=\frac{\frac{FG}{AF}}{\frac{GE}{AE}}$$
As for your error, $AE=4$, $AF=8$, so you have $AE=AF/2\ne 2AF$
