Have your battery thoroughly checked first at O'Reilly, Napa, etcetera. It could even be YOUR IGNITION SWITCH! Do you have a tilt-wheel steering column?
Then remove ALL of the cables and clean the terminals and posts on the Fender Well Solenoid. Then follow them to all of the Grounds which can reek havoc on our Trucks!
Some may say overkill but install a 1ga. x 4 foot Negative Ground Cable from the Battery to the Engine and then a 4ga. x 2 foot from the Engine to the frame, not cheap but well worth it!
Replace the Positive cable as well with a 1ga. as well.
Even "maintenance free batteries" can run low on electrolytes so remove the "permanent" caps and use ONLY Distilled Water. If the liquid level is below the plates then you are pretty much toast with a dead cell.
Unrelated but will make a tremendous difference is to replace ALL of the Vacuum Lines with Rubber Hose. You would be surprised as how many "hidden" leaks we have on our 87's!
You already have the largest "snorkel" for your Air Filter Box, the other being a 4.9L which I installed on my 5.0L.
I know that money is a problem for most all of us but a 5-Speed Manual Swap is always a good way to increase the MPG. I had an 87 7.5L and the C6 would shift into final drive at 25MPH! Not Good!
Remember the lead in; do what is free first!
Boon
Postscript: Follow the other posts and wait for others to "chime in."
First, when it's acting up, see if you start the truck by jumping the starter solenoid on the passenger side fender. The two large posts, just put the key in the "run" position, and then use a screw driver to connect the posts until it starts.
If that bypass works, the solenoid could be your problem.