added -Wextra compiler option and fixed warnings

* added -Wextra compile flag to make gcc complain about even more
* added -D_GNU_SOURCE compile flag so that strdup() and usleep() are defined for C99
* fixed gcc warnings