Lib: if config->workers is zero, set value based on number of CPU cores

If the config->workers is zero, the number of worker threads is
determinated based on the number of CPU cores.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Configure: add #LIBDIR# parser

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
lib: Move the workers check to the right place, fixes crash

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>