Let $F$ be a free group on a finite set $X$, and let $M$ be a finitely generated subgroup.

Marshall Hall's theorem states that $M$ is closed in the profinite topology on $F$. That is, $M$ is the intersection of some family of finite index subgroups of $F$.

Is there a purely algebraic/algorithmic proof of this fact not using any topological argument?

What I mean is that I expect the proof to go more or less like:

Let $m_1, \dots m_r$ be a finite set of generators for $M$, and take some $t \notin M$. It is sufficient to find an open subgroup containing $m_1, \dots, m_r$ bot not $t$. For this we just need to find an epimorphism to a finite group $\phi : F \rightarrow G$ such that $\phi(t)$ is not generated by $\phi(m_1), \dots, \phi(m_r)$. Here comes some construction (which should better be a computable function of $m_1, \dots,m_r,t$) of $G$ and $\phi$ ...