I usually pull them by sliding a thin pry bar under the shingle tab and popping the nail. Use a small block as a fulcrum. The damaged tab covering the nail should have a dab of roofing cement applied under it to seal the leak. Trying to pound the nail flush is usually futile as the nail will usually pop again. If there are a lot of these, it indicates the wrong fastener was used, or the nail was never flush to begin with.