Resolve link errors when building shared object

There was no closing -Wl,-no-whole-archive directive in the rule for shared object build, which results in multiple linking of some implicit libraries like libgcc.a.