The West African empires of Ghana, Mali and Songhai were able to thrive because