Effective Hamiltonians arise in multiple problems, including homogenization of Hamilton-Jacobi equations, nonlinear control systems, Hamiltonian dynamics, and Aubry-Mather theory. In Aubry-Mather theory, related objects, Mather measures, are also of great importance. Here, we combine ideas from mean-field games with the Hessian Riemannian flow to compute effective Hamiltonians and Mather measures simultaneously. We prove the existence and convergence of the Hessian Riemannian flow. In addition, we explore a variant of Newton's method that greatly improves the performance of the Hessian Riemannian flow. In our numerical experiments, we see that our algorithms preserve the non-negativity of Mather measures and are more stable than previous methods in problems that are close to singular.