The Republic of Ghana is named after the medieval Ghana Empire of West Africa.
The actual name of the Empire was Wagadugu.
Ghana was the title of the kings who ruled the kingdom.
It was controlled by Sundiata in 1240 AD, and absorbed into the larger Mali Empire. (Mali Empire reached its peak of success under Mansa Musa around 1307.)
Geographically, the old Ghana is 500 miles north of the present Ghana, and occupied the area between Rivers Senegal and Niger.
Some inhabitants of present Ghana had ancestors linked with the medieval Ghana.