Novak Djokovic produced a comeback to defeat Dominic Thiem in the men's singles final of Australian Open.