diff --git a/scripts/checklibs.sh b/scripts/checklibs.sh
index f7ad99e40427a9806a68ada071b968bb87d1e10c..100e0ddd3e518af5baa858c2804ae764feb16ef6 100755
--- a/scripts/checklibs.sh
+++ b/scripts/checklibs.sh
@@ -1,4 +1,4 @@
-#!bin/bash
+#!/bin/bash
 # Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
 # SPDX-License-Identifier: GPL-3.0-only
 # First commited by Florian Uhlig
@@ -13,7 +13,7 @@ LIBDIR=${2:-../lib}
 
 # find all libs
 # libraries are real files with the extensions .so and for macosx .dylib
-all_libs=$(find $LIBDIR -type f | grep -e \.dylib -e \.so)
+all_libs=$(find $LIBDIR -type f | grep -e \.dylib$ -e \.so$)
 
 tmpfile=$(mktemp)