Improve build: add <unistd.h> and use -O2 instead of -O3