Upvote:6
For many of the civilisations that had systems of writing the name that they used for their own country is preserved in the ancient texts themselves.
For example, the ancient Egyptians thought of their country as being composed of two parts: kmt or "Khemet" (meaning "The Black Land" - a reference to the fertile strip along the Nile), and dΕ‘rt or "Deshret" (meaning "The Red Land" - referring to the deserts beyond that fertile strip). They referred to themselves as Kmtyw or "The people of the Black Land" from at least the Old Kingdom, and possibly much earlier.
We also know that kmt comprised two parts - the kingdoms of Upper and Lower Egypt, possibly first unified by King Narmer, and commemorated on the Narmer Palette. Later kings were described as "nsw-bity" or "King of Upper and of Lower Egypt".
[kmt / dΕ‘rt / Kmtyw etc. are transliterations from the hieroglyphs. As with some other languages in antiquity, the written forms of the ancient Egyptian language did not include vowels, so transliterations are often written with added letters (often the letter "e") to aid pronunciation]
As another example (one you mention in the question), the Akkadian Empire apparently referred to themselves as "akkadattu" in the Akkadian language.