Cooperation in a Dynamic Social Environment