|"Africa Before the Scramble, 1876"|
The concept of "illegal immigrant" as it pertains to African countries is historically based primarily on colonially defined borders (e.g. Berlin Conference 1884-85, i.e. the "Scramble for Africa", and later 'tweaks' to the lines drawn on maps ... in some cases the colonists even effectively drew these lines right through local communities, splitting them - e.g. the Batswana groups have been split across four countries: Botswana, South Africa, Namibia and Zimbabwe). As compared to precolonial Africa, the borders (and the concept of "illegal immigrant" itself) were effectively an 'invention' of the colonists, imposed by force, that restricted people across Africa from exercising their right to freedom of travel across the African continent - e.g. they were (by and large) more free to travel before colonists came and declared that such traveling is "illegal". How can an African be "illegal" just for traveling in Africa? *
On the other end though, I largely (at least, in the current context) disagree with the concept of a 'unified African government' or even (roughly speaking) a 'United States of Africa' (I think if based on the current framework, that would be a disaster - it would only make it easier for corrupt politicians and 'Corporatocrats' to commit injustices, and current injustices within countries - e.g. crony-capitalist mineral 'ownership/rights' models, e.g. South African Mineral and Petroleum Resources Development Act which benefits mining cartels at the expense of the people, would probably be tragically 'writ large' on a continental scale). If a 'federated African government' were to arise, it would have to be with the express purpose of protecting individual rights, not violating them - it is unclear how in the current climate this could be prevented from happening and seems unlikely (there would need to be a widespread culture of respecting individual rights to begin with - this is absent) ... a Constitutional 'Bill of Rights' seems to have helped a little bit for the USA, but only to a limited degree, and hasn't prevented large-scale individual rights violations. I also would be in objection to any attempts to impose a single 'African fiat currency'.
I think a more appropriate and ethical approach for Africa would be something between what we have now (e.g. we might consider** [debatable?]) retaining most borders themselves, but re-conceptualize their purpose - e.g. perhaps just do a criminal/terrorist background check at the border, but otherwise mostly just rubber-stamp the movement of most travelers), and a 'Wisslerian' city-state model ***. (I think the city-state model is in some (perhaps rather loose/limited) ways conceptually closer to Africa's civilizational structures prior to colonization than what we have now.)
I also think we should create something similar to the Schengen area for Southern Africa (or ideally ultimately most [all?] of Africa) - e.g. members of Southern African countries should (by and large) be allowed to travel, move, settle, start businesses etc., and work in the other member countries. However, this should never be at the expense of 'ceding local rights' to centralized authorities/governmental structures - the primary and express purpose should be to free individuals - i.e. allowing individuals to exercise their natural rights (e.g. freedom of movement, freedom to travel and settle and work in other African / Southern African countries, the right to own property, the right to freedom of trade, freedom from imposition of unjust customs duties and taxes, etc.). Apart from being more just, this would likely 'incidentally' foster greater economic prosperity and more economic opportunities for Africans. (E.g. in the USA or EU it's easy, say, for members to move to other states or member nations to work, start businesses, trade, etc. - in Africa, Africans cannot easily do any of these due to the restrictive borders and legal regimes between African countries - so e.g. much basic trade or travel cannot take place, workers can't easily move to where there are employment opportunities across borders, etc.)
* Migrants who actually commit real crimes (e.g. theft) should be arrested and subjected to due process (or deported [debatable?]). The majority of so-called "illegal" immigrants don't commit crimes - most attempt to interact with locals on a mutually voluntary basis, and try to earn a living from 'honest employment'.
** Or perhaps the members of countries themselves should decide on this - but only insofar as they aren't violating the natural rights of others (it seems to me that many/most Africans today seem to feel a sense of 'national identity' with their colonially-defined jurisdictions - it seems unlikely they would want to shed this - my impression is most Africans identify in a positive way with their 'national identities', in spite of the historical origins thereof - so I'm not sure the answer is 'do away with the colonial borders' [open question?]).