A non-perturbative treatment of quantum impurity problems in real lattices