I managed to solve the problem on my own after all:
In case anyone else is using codeblocks on Ubuntu make sure you go to Settings->Compiler->Linker Settings->Other Linker Options and type “-pthread”.
My god! What a mess! If I survive these tutorials I might find some time to make a codeblocks guide.