Apple's iTunes software is, in the main, designed to transfer data from the computer to their devices but not in the other direction. In general if you try to connect and sync an Apple device to a new library iTunes will want to erase all the current media content on the device and replace it with items from the new library. See Move your iTunes library to a new computer for advice on moving a working library to a new computer if that is still a possibility.
If you have a backup of your iTunes library that has those playlists, they will be synced as well (when you restore that library). If those playlist only exist on your iPhone, they will be lost when you sync. For more info, see:
Move your iTunes library to a new computer - Apple Community
See also How to move your iTunes library to a new computer - Apple Support for Apple's approach to this topic.
If you don't have a backup, see:
Recover your iTunes library from your iPo… - Apple Community
Empty/corrupt iTunes library after upgrad… - Apple Community