During the Bronze Age, only Egypt was rich enough to build stone buildings. But during the Iron Age, starting about 1000 BC, other parts of Africa started to trade with other parts of the world, and got rich enough to build in stone.
In Meroe (modern Sudan), the kings and queens built themselves a big palace by around 900 BC. By 700 BC, people were building solid pyramids in Meroe, but they were much smaller and much later than the ones in Egypt.
Further south in Ethiopia, people were also beginning to build in stone, with a temple-tower dating the same time as the Meroe pyramids. The Ethiopians built their tower in the same style as the Arabs they were trading with.
Wealth began to spread west along the North African coast, too, as the people there started to trade with the Greeks and the Phoenicians. By the 800s BC, the Garamantes in Libya were building hill forts and living in mud-brick houses with stone foundations and floors paved with crushed potsherds. The city of Cyrene got started about 630 BC, and soon had stone houses, paved streets, and Greek-style temples.
Still further west, Phoenician colonists from West Asia founded the city of Carthage around 800 BC. They, too, started to build stone temples and fancier houses with paved pebble floors instead of dirt floors, and water drains to carry away waste. Soon Carthage became a big city with paved streets and a system of stone walls and docks at their seaport.
West of Carthage, in what is now Algeria, the Numidians also started to build in stone about 300 BC, with a strong stone wall around Cirta and probably large public buildings. There was a Carthaginian city at Volubilis in Morocco by the 200s BC, with a temple to Baal and a mudbrick city wall.
Even way on the other side of the Sahara Desert, further south in West Africa, the Soninke people at Tichit were also starting to build forts out of stone by 500 BC. The Nok people, further south, weren’t building in stone yet (even though they were smelting iron), but around 500 BC they started to move from stick houses to mud-brick houses. By 250 BC, Djenne-djenno (in modern Mali) had a 13 foot high mud-brick wall all the way around it, and almost 30,000 people living inside the walls.
Learn by doing: build a sand castle with a wall around it
Go on to Architecture in Africa in the time of the Roman Empire
Bibliography and further reading about the architecture of ancient Carthage: