Added missing pthread flag.

    This solves the problem of mutices being completely ignored.