Detect the required libraries instead of hardcoding them in LDFLAGS