Can atheists be saved just by acting charitably?
The short answer
No one saves himself, but God can save someone who in conscience cannot believe God exists yet lives as well as he knows how. His culpability may be lessened where others made belief hard for him, and Christ counts service to the least as service to him.
You are right that man cannot save himself. But God can choose to save someone who in conscience cannot believe that God exists yet lives as best he can by the knowledge he has.
Gaudium et Spes (19) says those who willfully shut God out and dodge religious questions are not following their conscience and are not free of blame, but believers often bear some responsibility: by neglecting their formation, teaching error or failing in religious, moral or social life, they hide rather than reveal the true face of God and religion. So an atheist's culpability may not be entirely his own, and where others made belief impossible for him, his guilt may be lessened. We must trust that he is not beyond God's mercy if he strives to live morally (cf. Lumen Gentium 16).
The second great commandment is love of neighbor (Matthew 22:39), and Christ said of those who serve others without explicitly doing it for him: "'Lord, when did we see you hungry and feed you, or thirsty and give you drink? When did we see you a stranger and welcome you, or naked and clothe you? When did we see you ill or in prison, and visit you?' And the king will say to them in reply, 'Amen, I say to you, whatever you did for one of these least brothers of mine, you did for me'" (Matthew 25:37-40).