Fixed compiling for MacOS X

* removed `-lrt` from `LDFLAGS` - seemed to be redundant;
* added opportunity to pass `CFLAGS` and `LDFLAGS` from environment.

PS. With `-Wextra` gcc reports about some unused vars and incorrect comparisons.