Ghana's new president John Mahama secured a comeback to the top job, tapping into economic frustrations in the country.