Update makefile for p48
Replace while loop with for