Isack Hadjar completed a remarkable turnaround to land a strong starting position for the United States Grand Prix.