Rory McIlroy birdied the final hole at Pinehurst No 2 during his opening round to tie the lead with Patrick Cantlay in the US Open.