First thing to do is check the fluid if the level is low you have a pressure leak look for fluid on the ground and coming out of the back of the master cylinder. If the fluid level is ok the master cylinder is by passing and needs to be replaced.
Often times people replace the brake shoes and ignore adjusting the brakes afterwards if this is the case you must adjust the rear brakes first.
If the peddle comes up after a few pumps chances are a brake adjustment will cure the problem.
If you have a good peddle on the first couple pumps and then rest your foot on the peddel and it slowly goes to the flour it's probably a bad master cylinder.