New Zealand golfer Ryan Fox has won The Open Championship after sinking a 12-foot birdie putt on the 18th hole at Royal Troon.