remove dependency on libgen.h (basename())