Made a dynamic check for BSD make and GNU make