Boundary layer formation in the transition from the Porous Media Equation to a Hele-Shaw flow