It sounds like the pump is getting air locked. An inverted foot valve can solve this problem.
A foot valve mounted upside down on the top of the pipe, will let the water coming in seek its level in the pipe.
Each time the pump comes on, it will close the foot valve and pump the water out to where it needs to go.
Foot valve pic