Checking port, make makefile more robust