Lewis Hamilton says he will "give it absolutely everything" for his final three races with Mercedes after struggling badly in the Sao Paulo Grand Prix.