build: slightly change and extend the logic of SMB_LIBRARY().