Ground states for the pseudo-relativistic Hartree equation with external potential