When using the parent -> child hierarchy in Salesforce, it's possible that you will see the CIRCULAR_DEPENDENCY error - "A parent account can't be the child of an account it's already a parent of" when executing a merge. This article will show you how to resolve this issue.
Remove the parent -> child relationship for your account in the manual merge page, by selecting the empty parent-id field.
Remove the parent -> child relationship for all (affected) accounts in Salesforce by (mass) updating them.
Develop a "merge plugin", in which you can execute apex code, which will make sure the parent-id field is emptied before the merge is fired. This is something that has to be developed by yourself.