Lewis Hamilton secured a sensational victory in Brazil after fighting back from tenth on the grid to take the chequered flag.