You'll have to clear security as soon as you land which can easily be 15-20 mins depending on how many other flights arrive at the same time. Luckily you'll likely be in terminal 3 which should be a short walk to your Africa flight. A bigger worry would be your bags getting transferred in time as FCO is notorious for poor baggage handling.
You'll only need to go through customs/immigration if you actually leave terminal 3 as it's a sterile area for non-EU flights.