One thing to check out if you haven’t bought your tickets to Spain yet, is adding the Santiago to Madrid leg to your original ticket. I fly from the US and find that adding domestic flights both from Madrid to my departure city (Valencia, Almería, Sevilla, Pamplona, Irún, etc) and from Santiago to Madrid usually adds no more than the cost of the extra days you would spend getting to start point and getting back to Madrid.
If you fly American or another One World partner (like BA and Iberia) it will be much more economical and convenient. And if your flights are all on one ticket, if delays mean you miss your connection, you are protected and the airline will rebook you. We’ve had several threads on this topic recently, and the strong advice from many forum members is never to flly into Madrid in the morning hoping to make a connection to a US-bound flight unless it’s all on one ticket.