Maximizing the Gains from Natural Resources