I'm guessing that it's too late to check about adding the flight from Santiago to Madrid onto your international ticket. I always fly in and out of Madrid on the international part, and I have found for the last few years that flying from Madrid to starting point at the beginning and then at the end flying from Santiago to Madrid and on home, all on one ticket, is not much more expensive than just flying from the US to Madrid and back. But if you already have your plane ticket, it's probably non-refundable. Just keep it in mind for you next camino.
That leaves you with overnight bus, which arrives at T4 (the new Barajas terminal) at 7 am. Leaves Santiago at 9:30 pm and costs 47 euros. There are day buses, but it sounds like you don't want to spend a night in Madrid, just arrive and get on the plane.
There is also an overnight train, leaves Santiago around 10:30 pm and gets to Madrid at 8 in the morning if it's on time (I've had a few late arrivals). Train prices vary dramatically depending on fare specials and on how far in advance you buy it. From the Chamartin train station to the airport it's a very quick trip (about 12 minutes) to the airport, so you should also be able to make it that way.
If you're flying out of T1,2, or 3, you'll have to take an intra-airport bus that makes the rounds among all the terminals. Iberia and its partners use T4, the rest of the airlines use the others.