Use a pointing mortar that is weaker than the original mortar, weaker than the surrounding masonry units (i.e. brick, stone etc.) and is more vapor permeable than the original mortar.