Fixes for raspbian

Changed to gcc-4.8 as default on Raspberry Pi
Added linker option -pthread on Raspberry Pi