Dan Evans qualified for the US Open after recording a 6-7 (3-7) 6-4 6-2 win over Adrian Menendez-Maceira.