Use PRI specifiers in printf formats
Fix unitialized memory access
Makefile: add LDFLAGS for overriding link settings