Lewis Hamilton has thanked Mercedes for their patience and trust after signing a new contract with the team.