Fix compatibility with linaro toolchain
Added compilation optimization flags