The map below will go a long way for understanding the puzzling presence of R1b in the under-gird of North Africa. Taken with a host of other artifacts, such as lithics, pottery, metallurgy and domestics, it offers at least one explanation for the changes in Western Iberia in the late 4th millennium B.C.
North African climate change is a slow and steady process punctuated by sudden collapses. One collapse began in the early 4th millennium (5.9 kiloevent) and possibly flooded the Upper Nile valley with immigrants from the Acacus (c3,600 B.C.). At the same time, this process pushed immigrants to Western Morocco (also archaeologically detectable) and eventually Iberia (IMO) which also experience dramatic social change and traditions.
The important point here is to note the population peak of grassy Sahara during its pastoral/dairy phase, followed by a burnout in which the population center begins shifting South and West, to the Sub-Sahel and the Oases. This burnout progressed since then; the Western Desert (Morocco, not Egypt) once respectably populated, is now in modern times completely uninhibited -completely-.
The presence of R1b in Northern Cameroon, Chad, Niger, Mali, etc, is the most likely the result of those immigrant populations looking for greener pastures. This is important in light of the modern emergence of Afro-Asiatics like the Berbers (at least the male half) that developed a nomadic life-style in the (now) desert based on browsing domesticates. (They apparently coming from a more easterly direction)
One thing worth checking out is Andrew's blog where he discusses the dichotomous situation between the genetics of Western Europe and Northern Africa. I think he has laid some of the problems out a little better than I've tried to.
The demographic response to Holocene climate change in the Sahara, Katie Manning, Adrian Timpson, (2014) [Link]