First, are you sure you want to spend $40k on a car? That's a lot of money and whatever you buy will depreciate to $10k or so after seven or eight years. Do you really want to give up at least $30k for nothing? How long did it take you to earn that money? Think it over.
If it helps, I'm itching to pick up another duplex in Arizona for $70k. Let's look at some numbers. I can get it with $7k down and get a $6,500 tax rebate. If I apply the tax credit to the property, then it ends up costing me about $55k. Plus, I get to write off depreciation, repairs, etc. etc. every year, which will save me a couple thousand.
Then there's the income. That'll be about $1,200 a month, or about $14k a year.
Anyhow, take a look at your priorities. If you have to have a luxury, high-end, sports, etc. car, then consider a used, depreciated one. If something like a 2000 model doesn't strike you as "good enough" then sit down and think whether a 2010 will be "good enough" in 2017.
Anyhow, the best time of year to deal with a dealership is in January and February at the end of the month. Any Christmas sales are long gone and they might have a few left over from the previous model year.
I find taking a few people along with me to up the pressure - especially when I bring my lawyer friends (I am one) and we carefully pick over contracts and ask legal questions. It makes salesmen sweat. Always a good time.

Also, I like to play several dealers off each other. Keep telling them things like "well, I really like your dealership and you're a great guy, but money is tight, etc. etc." Make them like you. Make them want to give you the best deal possible. The more time they have invested in your sale, the more willing they are to bend.