Autodetection of native machine and code optimization
Disable not needed cURL functions
Changed the order of some build instructions
Pass compile options via env. variables
Fixed compile script
Added env. variable to specify the number of threads [gh#300]
Fix for pthreads and cross_compile
Revert "Fix for pthreads and cross_compile"

This reverts commit 6b61bc11d0055b76ce32dce701107234dabb7a76.