detect arch to link correct soci libs

since the build server is x86, I can't naively use the lib64 dir for linking. 

I added a cmake script to detect the arch and select the lib dir accordingly