fix compilation flag and library path