Fix #628: Failed to set locale to en_US.UTF-8
Fix luajit compilation if some flags provided in $CC or $CXX variable

Users should be able to specify some flags in CC or CXX variables
instead of putting it to to C/CXXFLAGS (e.g. CC="cc --sysroot=xx -m32").
We faced with this problem on Intel Edison/Galileo SDK.