Hitching for rides is common practice in Africa, though you may be expected to pay the driver.
Road safety in Africa leaves a lot to be desired, and seatbelts are not always fitted. Being stranded in remote areas could be a problem.
Malaria is common in many parts of Africa. Inform yourself and take precautions. Some forms of malaria are particularly deadly. The fact that local populations don't take any malaria prophelactics should definitely not stop you from taking any: Africans are much more resistant to malaria.
Speaking English and French is an advantage. Portuguese in some countries. And learning African languages will make your trip much more pleasant. Some languages are understood in very large parts, such as Fulfulde and Bambara in West Africa.
In the Western Sahara rides are plentiful and usually free on the main paved roads connecting Laayoune, Dakhla and Smara. The UN does not give rides without official permission apparently, which is a shame as it seems they're the only people who can give you any insight into the political situation here. Local Moroccans will tell you all sorts.
Truck drivers may ask you to "sleep" in a discrete position to avoid the endless police passport checks (which can make you a bit of a burden to carry). This shouldn't be a problem if it's not too obvious, but you don't want to get on the wrong side of the police in Western Sahara (who can be rather paranoid).
Lifts with overland travellers to Mauritania can be found by asking around at Camping Moussaffir (just north of Dakhla).
The lorry drivers are lately reluctant to give a lift as then they have to bribe at each police post. It is better to omit that situation, and hitch to the post after Al-Uyuun and ask the police to pass the info on by phone to the next stop.