The premise that it is built for the "wrong war" is two fold. Design by committee didn't help the aircraft and made cost overruns and timelines worse but, the bigger premise or problem doesn't take to account that we still have other aircraft that fulfills other roles.
Also, the collaborative combat aircraft is being developed with the F22 and F35. Arguably though the collaborative combat aircraft is a bigger challenge than the F35 program as a whole and it is still in development whether it can be completed. We could downsize the F35 fleet or provide it in military aid but, I don't we can truly say wrong war it will still be available when a different war occurs and Aircraft have a long shelf life.
The F-35 is currently about the same price to procure as Gripen, a 4th generation non-stealthy fighter.
Anyone making claims about cost has a lot of work to do because the F-35 program is actually extremely cheap per unit now for what it is.
F-35 cost overruns are mostly solved. The cost of first-of-a-kind is always ludicrously expensive. Nth-of-a-kind, they're not so bad.