Existence of ground state solutions to the nonlinear Kirchhoff type equations with potentials