Allow static linking & fix compilation issue