"And he believed in the LORD, and it was counted as righteousness (or charity) for him."
One could explain that Abraham our father, peace be upon him, considered it to be charity that God told him "your reward is very abundant". It seems from this that actually the reward came to him for his good deeds. However, Abraham thought that nothing was coming to him from God, and His promise to him was only a free gift, like charity. Also, one could explain that the verse "and he believed in the LORD" teaches the power of faith. Abraham considered that everything that God gave him was like charity, because when God promises a person reward according to his deeds, it is possible that one's sins could subtract from the reward. But the power of faith is that when one believes in God, and he knows that there is no measure to His Greatness, then all of a person's own good deeds are considered to be insignificant when compared to the Loftiness of God. If that is so, one does not deserve to be rewarded for his own good deeds. But the power of this faith in God is to consider everything that God gives him to be charity, therefore it exists constantly.
(Sefer Divrei Binah - Parshas Lech Lecha p. 49)