Just back in Lagos from the North of Spain. Salamanca area.)
I drove Madrid to Lagos last May 2009.
There are two routes.
1) Madrid - Cordoba - Seville
2) Madrid - Merida - Seville - Lagos.
On Saturday, I ran Salamanca to Lagos on the A66 Ruta da Prata in 8 hours with stops, cruising at the speed limit. Merida to Lagos took me about 4,5 hours. The A5 from Madrid to Merida took about 4 hours last year.
There are no tolls on the Spanish side once you leave Madrid.
Route 2, although a bit longer offers much better road quality, (Motorway throughout and does not require transiting Seville which can be a pain owing too traffic.)
Do not forget to fuel up either at the Cartaya or Ayamonte Service Areas before you leave Spain as fuel is up to 20c/l cheaper in Spain that in Portugal