The extraction of natural resources: The role of thermodynamic efficiency