Since the weak topology is Hausdorff, there is an open set containing $m$ and disjoint from $K$. So we can find $f_1,...,f_n$ and $\varepsilon$ such that the open set $$\{\mu \mid \int f_i dm -\varepsilon < \int f_i d\mu < \int f_i dm +\varepsilon \quad \forall \ i \}$$ does not contain $K$. Now project everything on ${\bf R}^n$ with the map $\mu \mapsto (\int f_1 d\mu,..., \int f_n d\mu)$. The projections of $K$ and the open set are two disjoint convex sets that can be separated by an hyperplane $\{H=\sum a_i x_i +c=0\}$ with $H<0$ on the projection of $K$ and $H>0$ on the projection of the open set (which is just a small cube). Take $g=\sum a_i f_i +c$.