Individual adaptations and structural change as solutions to social dilemmas