Shane Lowry has made the cut at the Open despite being handed a two-stroke penalty in his second round.