So we need to show:
$$\overline{M} = X \leftrightarrow \forall V \subseteq X \text{ open and non-empty } : V \cap M \neq \emptyset$$
Now it will depend on how you define $\overline{M}$. If you define it as the smallest closed subset that contains $M$ (one of the usual definitions) I'd go as follows:
Left to right: assume $\overline{M} =X$ and let $V$ be any non-empty open subset of $X$. Then $M \nsubseteq X \setminus V$, or otherwise the latter set would be a smaller closed subset than $X$ that contained $M$. So there is always a point of $M$ that is not in $X \setminus V$, or put equivalently: $M$ always intersects $V$, as required.
Right to left: suppose the right hand condition holds. Then let $C$ be a closed subset of $X$ with $M \subseteq C$. We want to show that $C =X$ (so $X$ is then the only (hence smallest) closed superset of $M$). If $C \neq X$, $V = X\setminus C$ is non-empty and open, but $V \cap M = \emptyset$, this contradicts the right hand condition. So $C = X$.
Another common definition is that $\overline{A}$ is the set of all adherence points of $A$, i.e. all $x \in X$ such that for any open set $O$ that contains $x$, $O \cap A \neq \emptyset$.
In that case the equivalence is more immediate:
Left to right. If $V \neq \emptyset$ is open then for $p \in V$ we have that $p$ is an adherence point of $M$, as $\overline{M} = X$, and so $V$ must intersect $M$.
Right to left: suppose $p \in X$. Then let $O$ be any open set that contains $p$. Then the right hand condition implies that $O \cap M \neq \emptyset$. So $p$ is an adherence point of $M$ and as $p \in X$ was arbitrary, $\overline{M} =X$
If your definition of closure is different, please let us know.