Can profit on the sale of a spec home count as long term capital gains if the land was purchased more than a year earlier?
No, it's not all long-term capital gain. Depending on the facts of your situation, it will be either ordinary income or partially short-term capital gain. You should consider consulting a tax lawyer if you have this issue.
This is sort of a weird little corner of the tax law. IRC §§1221-1223 don't go into it, nor do the attendant Regs. It also somewhat stumped the people on TaxAlmanac years ago (they mostly punted and just declared it self-employment income, avoiding the holding period issue). But I did manage to find it in BNA Portfolio 562, buried in there. That cited to a court case Comm'r v. Williams, 256 F.2d 152 (5th Cir. 1958) and to Revenue Ruling 75-524 (and to another Rev. Rul.). Rev Rul 75-524 cites Fred Draper, 32 T.C. 545 (1959) for the proposition that assets are acquired progressively as they are built. Note also that land and improvements on it are treated as separate assets for purposes of depreciation (Pub 946).
So between Williams (which says something similar but about the shipbuilding industry) and 75-524, as well as some related rulings and cases, you may be looking at an analysis of how long your property has been built and how built it was. You may be able to apportion some of the building as long-term and some as short-term. Whether the apportionment should be as to cost expended before 1 year or value created before 1 year is explicitly left open in Williams. It may be simpler to account for costs, since you'll have expenditure records with dates.
However, if this is properly ordinary income because this is really business inventory and not merely investment property, then you have fully ordinary income and holding period is irrelevant. Your quick turnaround sale tends to suggest this may have been done as a business, not as an investment.
A proper advisor with access to these materials could help you formulate a tax strategy and return position. This may be complex and law-driven enough that you'd need a tax lawyer rather than a CPA or preparer. They can sort through the precedent and if you have the money may even provide a formal tax opinion. Experienced real estate lawyers may be able to help, if you screen them appropriately (i.e. those who help prepare real estate tax returns or otherwise have strong tax crossover knowledge).