Yes but you have to alter the dynamics of the Scramble for Africa (or neuter it by making direct annexation unappealing) while changing the internal dynamics so the civil wars near the end are averted. Although its worth noting they /could/ produce gunpowder weaponry, the problem was the Caliphate lacked the know how to mass produce rifles and artillery.
Unfortunately, I can't remember off the top of my head how to alter the internal politics for stability, but as for the Scramble you can certainly delay and reduce its intensity via:
-Preventing the Berlin Conference (therefore making colonization less "necessary" as there is fear of being "locked out" of a strategic area while also making colonization riskier)
-Have the Ottomans win the Russo-Turkish War of 1876, preventing the British occupation of Egypt, the crippling of the Ottomans (they had substantial contacts with Bornu and the Sahel, so even if Britain and France don't sell or help you make guns, the Turks will)
-Prevent the French Third Republic from forming (much of the expansion south was driven by a need to recover prestige lost in the Franco-Prussian War)
-Prevent or end the Long Depression of the 1870s. It created a demand for new (captive) markets. Maybe if some other areas was booming and could absorb the sluggish demand for goods? Maybe Latin America starts industrializing earlier? Certainly would mean a greater demand for European products. Alternatively or both, start up Palm oil plantations in the Caribbean and Brazil much earlier than OTL to reduce demand from West Africa.
-Have a massive European War during the Belle Epoque. Colonization as doable in part because Europe was stable and growing. Have it broken, bankrupt and battered and it won't have the energies or will to expand on costly foreign ventures.
-Have the Powers that be decide to use Sokoto as a buffer state. Certainly would be useful as that, and open to trade with everyone.