Updated compile script to handle shared libraries