The usual way to solve problems such as this is to Fourier transform: Call your function $f(g_c)$, then its Fourier transform $$F(\xi)=\int_{-\infty}^\infty f(g_c)e^{i\xi g_c}dg_c=\int_{-\infty}^\infty m(x)f_X(x) e^{i\xi G(x)}\,dx$$ no longer contains the Dirac delta function. You can then recover $f(g_c)$ by an inverse Fourier transform. Whether or not this is doable in some closed form will of course depend on your choice of the functions $m$, $f_X$, and $G$.