Intermittents are the absolute worst to track down.
Like winterbeater, I'm never an advocate of throwing parts at a problem and you can test the crank sensor and cleaning the connector to if you want as mentioned, but be aware that it might test good unless you are IN a no-start condition.
I think the odds are pretty high that the crank sensor is your culprit. Buy a good quality one if you go that route. Use the SEARCH function for more information and tips on replacing it. It's in a pretty tight spot.
-------------------------------------------------------------------
Crankshaft Position Sensor: (CPS/CKP) Failure Symptoms / Testing
*Both the fuel gauge and or voltage gauge may not work/display
*It is possible that you may see a
No Bus on the odometer (on newer models only)
*You will have no spark. Fuel pressure may check out okay at the fuel rail, but fuel won’t get to the fuel injectors
*For 96 + newer, sometimes the OBDII code reader has trouble connecting to /reading codes. Crankshaft position sensor failure may or may not result in a check engine light/fault code.
*Crankshaft position sensors can be intermittent resulting in an abrupt misfire. "Thermal failure" is common. Thermal fail means that the sensor fails when engine gets hot, but works again when engine cools down. Be aware of this when testing, as if you have a sensor that suffers from thermal failure, it’s possible that it may test GOOD as soon as it cools down.
*Don’t get tunnel vision and assume the sensor is bad (unless it checks out as bad with a meter) Damaged wiring or a dirty connector can inhibit the signal from making it to the computer. Check/clean/repair as necessary.
------------------------------------------------------------------------------------------------
CRANKSHAFT SENSOR TESTING PROCEDURE: 1991 – 2001 4.0L H.O. engines
1. Near the rear of intake manifold, disconnect sensor pigtail harness connector from main wiring harness.
2. Place an ohmmeter across terminals B and C. The terminals are identified as A-B-C looking into connector from left to right with the "notch" in the middle of the connector on your right. Ohmmeter should be set to 1K-to-10K scale for this test.
3. The meter reading should be open (infinite resistance). Replace sensor if LOW RESISTANCE
---------------------------------------------------------------------------------------
CRANKSHAFT SENSOR TESTING PROCECURE: 1987 – 1990 4.0 L engines
Test # 1
Get a volt/ohm meter and set it to read 0 - 500 ohms. Unplug the sensor and measure across the connector's A & B leads. Your meter should show a resistance of between 125 - 275 ohms. If the reading is out of range, replace sensor.
Test # 2
You'll need a helper for this one. Set the volt/ohm meter to read 0 - 5 AC volts or the closest AC Volts scale your meter has to this range. Measure across the CPS leads for voltage generated as your helper cranks the engine. (The engine can't fire up without the CPS connected but watch for moving parts just the same!) The meter should show .5 - .8 VAC when cranking. If it's below
.5 VAC, replace sensor.