Well, quick-fix: I've changed `LDFLAGS=... -lpthread` to `LIBS=-lpthread` and now all works like a charm. So, I guess, that `-lpthread` should be somehow upstreamed now, isn't it?