Switch from build.sh to makefile.
Included missing header and used C99 usleep().