Rewarding endowments lead to a win-win in the evolution of public cooperation and the accumulation of common resources