Energy-Efficient M2M Coomunications with Energy Harvesting Sources