fixed cflags and required libraries to build it as shared