Lipschitz approximation by harmonic functions and some applications to spectral synthesis