1996 Cherokee engine stalls

I have a 1996 Cherokee, 5 speeed manual, 4.0L, former forestry service Jeep with 90,000 mi. in great shape. The engine will periodically just stop. After a 15 min. wait, it starts right up. Initially it stalled after an hr. or so in the border line returning to the U.S. but it is now happening more frequently and at low speeds. Engine temp is fine. When I was stalled in the border line, a passing Jeep driver said he had the same problem and his fix was to hit the solenoid. Any suggestions?