Revert "adding lock for race condition"
This reverts commit
168f63a79a7e0ae9a0e1f65d3e650b4cd11b24b5.
Fix for 64 bit compatibility.
- Use %cmake macro to set default path
- Fix hard-coded library path
- Fix the wrong cast between int and pointer.
Change-Id: I4c0636e5e2e30f07f72aea9063de06d588bef901