Fixing build failures on Ubuntu 12.04 LTS 64-bit

Build failures caused by:
1. modtime update latency
2. Current file's dirname, nested deeply in application's root folder