configure: fix logic for threads in case of OpenCL is enabled. Fixes ticket 3004.

Signed-off-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>