Some minor Makefile improvements

- Enable compiler optimizations (-O2)
- Split CFLAGS and LIBS into two pkg-config calls

Signed-off-by: Uli Schlachter <psychon@znc.in>
Refactor into using asynchrous functions

Signed-off-by: Uli Schlachter <psychon@znc.in>
Add some options to notify sources

Signed-off-by: Uli Schlachter <psychon@znc.in>
Add command line option handling

Signed-off-by: Uli Schlachter <psychon@znc.in>