Test thread support before create Makefile, to avoid installation in systems without threads support