From everything I have seen, the war in North Africa was solely about getting oil from the Middle East. Had oil simply not been discovered in North Africa during the time of the war?
To put it simply: Yes, North African oil had not yet been discovered and exploited in an industrial fashion. North African oil development did not commence properly until the late 1940s and early 1950s.
Now, to redress the misconception in your question... The North African campaign was the result of European countries neo-colonial ambitions of the early 20th century, the French, the Italians and the British who held the Suez canal. Following the declarations of war which led to WWII, Mussolini ordered advances into Egypt. His motive being twofold: demonstrate Italy's willingness to fight with the Germans and to cut off the supply lines to Britain's eastern colonies. These endeavours proved ill fated. The British then had the initiative and made thorough progress until they were stymied by the arrival of the Deutsches Arikakorps. The following campaign saw the front move back and forth multiple times, until the British proved that their logistical efforts were better than the Germans and the closing of the Tunisia campaign. Here lies the crux of the situation, had there been oil exploitation in the region, then a sizable chunk of the logistical headaches for both sides would have been reduced. As has been mentioned in the comments, the Germans wanted the Caucasian oil fields and the British oil came from it's eastern colonies or the United States.
The war in North Africa would arguably not have happened had both sides not had colonial investments there. As it was they did and this meant for the British a risk to their vital shipping through the Mediterranean. From the outset of the war the British aimed to cripple the Italian navy by sinking it in its ports and on the High Seas, to deny the Germans access to the Mediterranean by controlling the entry points and to enact aerial cover over the sea through airbases at Gibraltar, Malta, Crete, Cyprus, Greece, Egypt... so as to sink axis shipping and prevent resupply of the forces in North Africa.