Rory McIlroy made a birdie on his final hole of the second round of the US Open at Oakmont Country Club to guarantee a spot for the weekend.