On fedora based distros libpthread.a has a single .o file created with ld -r. That means that just one reference will pull the entire library.
On debian based systems that is not the case and we need whole archive when static linking.
Without this a static linked lld will crash on startup. It calls std::thread functions which try to call the corresponding pthread_* function but fail because they use a weak reference to pthread_* which is resolved to 0.